import MixinModel from '@/mixins/MixinModel'

export default {
  mixins: [MixinModel],

  data() {
    return {
      storeModel: 'ProductProduct',

      config: {
        path: {
          form: '/erp/product/form',
          view: '/erp/product/view'
        },

        propForList: {
          title: rec => {
            return `名称 ${rec.name}`
          },
          label: rec => {
            return ``
          },
          value: rec => {
            return `成本 ¥${rec.standard_price} 价格 ¥${rec.list_price}`
          }
        },

        propForView: [
          { web_type: 'field', name: 'name', label: '名称' },
          { web_type: 'field', name: 'list_price', label: '价格' },
          { web_type: 'field', name: 'standard_price', label: '成本' }
        ],

        titleCreate: '创建产品',
        titleWrite: '编辑产品',
        submitBtn: { text: '提交' },

        fieldsForForm: [
          {
            name: 'name',
            type: '',
            label: '名称',
            placeholder: '请填写产品名称',
            rules: [{ required: true, message: '请填写名称' }]
          },
          {
            name: 'list_price',
            type: 'number',
            label: '价格',
            placeholder: '请填写产品价格',
            rules: [{ required: true, message: '请填写价格' }]
          },
          {
            name: 'standard_price',
            type: 'number',
            label: '采购成本价',
            placeholder: '请填写产品成本价'
            // rules: [{ required: true, message: '请填写成本价' }]
          }
        ]
      }
    }
  },
  computed: {},
  watch: {},
  created() {},
  methods: {}
}
